<page-header model="navModel"></page-header>

<div class="page-container page-body">

	<h3 class="page-heading">添加新密钥</h3>

	<form name="addTokenForm" class="gf-form-group">
		<div class="gf-form-inline">
			<div class="gf-form max-width-21">
				<span class="gf-form-label">密钥名称</span>
				<input type="text" class="gf-form-input" ng-model='token.name' placeholder="名称"></input>
			</div>
			<div class="gf-form">
				<span class="gf-form-label">角色</span>
        <span class="gf-form-select-wrapper">
            <select class="gf-form-input gf-size-auto" ng-model="token.role" ng-options="r.value as r.text for r in roleTypes"></select>
        </span>
			</div>
			<div class="gf-form">
				<button class="btn gf-form-btn btn-success" ng-click="addToken()">添加</button>
			</div>
		</div>
	</form>

	<h3 class="page-heading">现有密钥</h3>
	<table class="filter-table">
		<thead>
			<tr>
				<th>名称</th>
				<th>角色</th>
				<th style="width: 34px;"></th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="t in tokens">
				<td>{{t.name}}</td>
				<td>{{t.translation}}</td>
				<td>
					<a ng-click="removeToken(t.id)" class="btn btn-danger btn-mini">
						<i class="fa fa-remove"></i>
					</a>
				</td>
			</tr>
		</tbody>
	</table>
</div>



